import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/server',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/server',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/server',
    method: 'put',
    data
  })
}

export function getPages() {
  return request({
    url: 'api/applyInfo/selectPages',
    method: 'get'
  })
}

export function approval(data) {
  return request({
    url: 'api/applyInfo/approval',
    method: 'post',
    data
  })
}

export function selectSpjg(data) {
  return request({
    url: 'api/applyInfo/selectSpjgPages?page='+(data.page.page-1)+'&size='+data.page.size+
    '&applyUserName='+data.applyUserName+'&instanceName='+data.instanceName+
    '&execType='+data.execType,
    method: 'get'
  })
}

export function selectDsp(data) {
  return request({
    url: 'api/applyInfo/selectPages?page='+(data.page.page-1)+'&size='+data.page.size+
    '&applyUserName='+data.applyUserName+'&instanceName='+data.instanceName+
    '&execType='+data.execType,
    method: 'get'
  })
}

export default { add, edit, del,getPages,approval, selectSpjg }
